package algorithm.poj.p1000;

import java.util.Arrays;


/**
 * 分析：
 * 实现：
 * 经验和教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P1316 {

	public static void main(String[] args) throws Exception {

		int[] ds = new int[10001];
		for (int i = 1; i < ds.length; i ++) {
			ds[i] = d(i);
		}
		Arrays.sort(ds);
		StringBuffer sb = new StringBuffer("");
		for (int n = 1; n <= 10000; n ++) {
			if (Arrays.binarySearch(ds, n) < 0) {
				sb.append(n).append("\n");
			}
		}
		System.out.println(sb);
	}
	
	private static int d(int n) {
		
		int s = n;
		while (n>0) {
			s += n%10;
			n /= 10;
		}
		return s;
	}
}
